package root.electronclass.electronclass.mvp.entity;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author yxq
 * @since 2022-11-09
 */
//"学校信息对象", description = "")
public class OrgSchoolInfoVO implements Serializable {


    private Long id;
    /**
     * 创建时间
     */
    //@ApiModelProperty(value = "创建时间")
    private String createTime;
    //@ApiModelProperty(value = "学校编码")
    private String schoolId;
    //@ApiModelProperty(value = "校名")
    private String schoolName;
    //@ApiModelProperty(value = "校训")
    private String motto;
    //@ApiModelProperty(value = "学校类别 1-幼儿园  2-小学  3-初中   4-高中   5-大学  6-中职  7-特殊教育学校 8-九年一贯制 9-十二年一贯制 10-成人学校 11-完全中学")
    private int schoolType;
    //@ApiModelProperty(value = "学校性质 1-公办 2-民办")
    private int schoolNature;
    //@ApiModelProperty(value = "建校时间")
    private String buildDate;
    //@ApiModelProperty(value = "上级部门")
    private String goverment;
    //@ApiModelProperty(value = "学校简介")
    private String introduction;
    //@ApiModelProperty(value = "占地面积，单位：亩")
    private String areaNum;
    //@ApiModelProperty(value = "详细地址")
    private String address;
    //@ApiModelProperty(value = "经度")
    private String longitude;
    //@ApiModelProperty(value = "纬度")
    private String latitude;
    //@ApiModelProperty(value = "招生电话")
    private String enrollmentTelephone;
    //@ApiModelProperty(value = "学校邮箱")
    private String mail;
    //@ApiModelProperty(value = "学校标识码，社会信用代码")
    private String schoolCode;
    //@ApiModelProperty(value = "负责人名称")
    private String principalName;
    //@ApiModelProperty(value = "学校类型 1-全日制学校 2-半工(农)半读学校 3-业余学校")
    private int schoolCategory;
    //@ApiModelProperty(value = "任教老师数量")
    private int teacherCount;
    //@ApiModelProperty(value = "学生数量")
    private int studentCount;
    //@ApiModelProperty(value = "师生比例")
    private String ratio;
    //@ApiModelProperty(value = "学校logo")
    private String logo;
    //@ApiModelProperty(value = "学校封面图")
    private String cover;
    //@ApiModelProperty(value = "来源 1-智慧校园 2-健康码平台")
    private int dataSource;
    //@ApiModelProperty(value = "组织机构ID")
    private Long deptId;
    //@ApiModelProperty(value = "校园宣传")
    private String videoJson;
    //@ApiModelProperty(value = "校园风采")
    private String picJson;
    //@ApiModelProperty(value = "备用字段")
    private String temp1;

    private String gradeName;

    private List<SchoolPicDto> picJsonFormat;

    private List<PicDto> videoJsonFormat;

    private List<PicDto> logoFormat;

    public List<PicDto> getLogoFormat() {
        return logoFormat;
    }

    public void setLogoFormat(List<PicDto> logoFormat) {
        this.logoFormat = logoFormat;
    }

    public List<SchoolPicDto> getPicJsonFormat() {
        return picJsonFormat;
    }

    public void setPicJsonFormat(List<SchoolPicDto> picJsonFormat) {
        this.picJsonFormat = picJsonFormat;
    }

    public List<PicDto> getVideoJsonFormat() {
        return videoJsonFormat;
    }

    public void setVideoJsonFormat(List<PicDto> videoJsonFormat) {
        this.videoJsonFormat = videoJsonFormat;
    }

    //@ApiModelProperty(value = "办学条件")
    private String bxtj;
    //@ApiModelProperty(value = "办学成果")
    private String bxcg;
    //@ApiModelProperty(value = "学校荣誉")
    private String xxry;


    //@ApiModelProperty(value = "所属区县")
    private OrgRegion region;

    //@ApiModelProperty(value = "校长")
    private UserInfoTeacherVO leader;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(String schoolId) {
        this.schoolId = schoolId;
    }

    public String getSchoolName() {
        return schoolName;
    }

    public void setSchoolName(String schoolName) {
        this.schoolName = schoolName;
    }

    public String getMotto() {
        return motto;
    }

    public void setMotto(String motto) {
        this.motto = motto;
    }

    public String getSchoolType() {
        switch (schoolType) {
            case 1:
                return "幼儿园";

            case 2:
                return "小学";

            case 3:
                return "初中";

            case 4:
                return "高中";

            case 5:
                return "大学";

            case 6:
                return "中职";

            case 7:
                return "特殊教育学校";

            case 8:
                return "九年一贯制";

            case 9:
                return "十二年一贯制";

            case 10:
                return "成人学校";

            case 11:
                return "完全中学";

            default:
                return "";
        }

    }

    public String getGradeName() {
        return gradeName;
    }

    public int getGradeNum(){
        if (gradeName.contains("2021") && schoolType == 3){
            return 1;//初三
        }else if (gradeName.contains("2018") && schoolType == 4){
            return 2;//高三
        }else {
            return 0;
        }

    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public void setSchoolType(int schoolType) {
        this.schoolType = schoolType;
    }

    public String getSchoolNature() {
        switch (schoolNature) {
            case 1:
                return "公办";
            case 2:
                return "民办";

            default:
                return "";
        }

    }

    public void setSchoolNature(int schoolNature) {
        this.schoolNature = schoolNature;
    }

    public String getBuildDate() {
        return buildDate;
    }

    public void setBuildDate(String buildDate) {
        this.buildDate = buildDate;
    }

    public String getGoverment() {
        return goverment;
    }

    public void setGoverment(String goverment) {
        this.goverment = goverment;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getAreaNum() {
        return areaNum;
    }

    public void setAreaNum(String areaNum) {
        this.areaNum = areaNum;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getEnrollmentTelephone() {
        return enrollmentTelephone;
    }

    public void setEnrollmentTelephone(String enrollmentTelephone) {
        this.enrollmentTelephone = enrollmentTelephone;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getSchoolCode() {
        return schoolCode;
    }

    public void setSchoolCode(String schoolCode) {
        this.schoolCode = schoolCode;
    }

    public String getPrincipalName() {
        return principalName;
    }

    public void setPrincipalName(String principalName) {
        this.principalName = principalName;
    }

    public int getSchoolCategory() {
        return schoolCategory;
    }

    public void setSchoolCategory(int schoolCategory) {
        this.schoolCategory = schoolCategory;
    }

    public int getTeacherCount() {
        return teacherCount;
    }

    public void setTeacherCount(int teacherCount) {
        this.teacherCount = teacherCount;
    }

    public int getStudentCount() {
        return studentCount;
    }

    public void setStudentCount(int studentCount) {
        this.studentCount = studentCount;
    }

    public String getRatio() {
        return ratio;
    }

    public void setRatio(String ratio) {
        this.ratio = ratio;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public int getDataSource() {
        return dataSource;
    }

    public void setDataSource(int dataSource) {
        this.dataSource = dataSource;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getVideoJson() {
        return videoJson;
    }

    public void setVideoJson(String videoJson) {
        this.videoJson = videoJson;
    }

    public List<SchoolPicDto> getPicJson() {
        if (picJson != null && !picJson.isEmpty()) {
            Gson gson = new Gson();
            return gson.fromJson(picJson, new TypeToken<List<SchoolPicDto>>() {
            }.getType());

        }
        return null;
    }

    public void setPicJson(String picJson) {
        this.picJson = picJson;
    }

    public String getTemp1() {
        return temp1;
    }

    public void setTemp1(String temp1) {
        this.temp1 = temp1;
    }

    public String getBxtj() {
        return bxtj;
    }

    public void setBxtj(String bxtj) {
        this.bxtj = bxtj;
    }

    public String getBxcg() {
        return bxcg;
    }

    public void setBxcg(String bxcg) {
        this.bxcg = bxcg;
    }

    public String getXxry() {
        return xxry;
    }

    public void setXxry(String xxry) {
        this.xxry = xxry;
    }

    public OrgRegion getRegion() {
        return region;
    }

    public void setRegion(OrgRegion region) {
        this.region = region;
    }

    public UserInfoTeacherVO getLeader() {
        return leader;
    }

    public void setLeader(UserInfoTeacherVO leader) {
        this.leader = leader;
    }
}
